'''
couple求出和为tsum的i的互补的数，顺序是从大到小
然后如果这个互补的数在array中则证明数列中有2个数相加为sum
一头一尾乘积最小
'''
# -*- coding:utf-8 -*-
class Solution:
    def FindNumbersWithSum(self, array, tsum):
        # write code here
        couple = [tsum-i for i in array]
        filterArray = [i for i in array if i in couple]
        try:
            return [filterArray[0],filterArray[-1]]
        except:
            return []